<?php

//require_once  __DIR__ . '/includes/authenticate.php';

if (isset($_POST['season']) && isset($_POST['teamname']) ) {
	
	$season = $_POST['season'];
	$teamname = $_POST['teamname'];
	
	include_once './db_bb_connect.php';
	
	$sql = "INSERT INTO opponents (season, teamname)
	VALUES ('$season','$teamname')";

	if ($db->query($sql)) {
		echo "<br><center><strong>Opponent has been succesfully added! </strong></center>";
	} else {
		echo "<br><center>Error: " . $sql . "<br>" . $db->error . "</center>";
	}
} 

?>
